package edu.zut.hb.ambition.purchase.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PurchaseMapper;
import com.ruoyi.system.domain.Purchase;
import com.ruoyi.system.service.IPurchaseService;

/**
 * 用品采购Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-06-08
 */
@Service
public class PurchaseServiceImpl implements IPurchaseService 
{
    @Autowired
    private PurchaseMapper purchaseMapper;

    /**
     * 查询用品采购
     * 
     * @param caigouid 用品采购主键
     * @return 用品采购
     */
    @Override
    public Purchase selectPurchaseByCaigouid(Long caigouid)
    {
        return purchaseMapper.selectPurchaseByCaigouid(caigouid);
    }

    /**
     * 查询用品采购列表
     * 
     * @param purchase 用品采购
     * @return 用品采购
     */
    @Override
    public List<Purchase> selectPurchaseList(Purchase purchase)
    {
        return purchaseMapper.selectPurchaseList(purchase);
    }

    /**
     * 新增用品采购
     * 
     * @param purchase 用品采购
     * @return 结果
     */
    @Override
    public int insertPurchase(Purchase purchase)
    {
        return purchaseMapper.insertPurchase(purchase);
    }

    /**
     * 修改用品采购
     * 
     * @param purchase 用品采购
     * @return 结果
     */
    @Override
    public int updatePurchase(Purchase purchase)
    {
        return purchaseMapper.updatePurchase(purchase);
    }

    /**
     * 批量删除用品采购
     * 
     * @param caigouids 需要删除的用品采购主键
     * @return 结果
     */
    @Override
    public int deletePurchaseByCaigouids(Long[] caigouids)
    {
        return purchaseMapper.deletePurchaseByCaigouids(caigouids);
    }

    /**
     * 删除用品采购信息
     * 
     * @param caigouid 用品采购主键
     * @return 结果
     */
    @Override
    public int deletePurchaseByCaigouid(Long caigouid)
    {
        return purchaseMapper.deletePurchaseByCaigouid(caigouid);
    }
}
